package com.store.webstore.service.impl;

import com.store.webstore.dao.CategoryMapper;
import com.store.webstore.dao.ProductMapper;
import com.store.webstore.entity.Category;
import com.store.webstore.entity.Product;
import com.store.webstore.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class IndexServiceImpl implements IndexService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Category> findCategoryList() {
        return categoryMapper.selectList();
    }

    @Override
    public List<Product> findHotProduct() {
        return productMapper.findHotProduct();
    }

    @Override
    public List<Product> findCompetList() {
        return productMapper.findCompetList();
    }
}
